const app = getApp()
const util = require('../../util.js')

Component({
  mixins: [],
  data: {
    text: '',
    enableLog: false
  },
  props: {
    tag: ''
  },

  onInit() {
    this.$page.debugView = this
    this.setData({
      text: app.globalData.logger.getLogHistory(),
      enableLog: app.globalData.logger.getLogLevel() > 0
    })
  },
  didMount() {},
  didUpdate() {},
  didUnmount() {},

  methods: {
    onClearClick() {
      app.globalData.logger.clearLogHistory()
      this.setData({
        text: ''
      })
    },

    onClipboardClick() {
      app.globalData.logger.copyLogToClipboard()
    }
  }
})
